package ru.spb.osll.myfit.client.widget.filter;

import ru.spb.osll.myfit.common.filter.MatchFilter;
import ru.spb.osll.myfit.common.filter.PageResultFilter;


/**
 * User: Alexander Opeykin
 * Date: 4/11/12
 */


/**
 * Creates widgets for all filters. Used for double dispatch with
 * PageResultFilter`s method createWidget(FilterWidgetCreator)
 */
public class FilterWidgetCreator {

  public FilterWidget create(PageResultFilter filter) {
      if (MatchFilter.class.equals(filter.getClass())) {
        return new MatchFilterWidget((MatchFilter)filter);
      }

    return null;
  }
}
